local skel = fk.CreateSkill {
  name = "rmt__zuhe",
  tags = {Skill.Lord},
}

Fk:loadTranslationTable{
  ["rmt__zuhe"] = "族合",
  [":rmt__zuhe"] = "主公技，当你回复体力至体力上限后，你可以将手牌摸至场上汉势力角色姓氏数。",

  ["$rmt__zuhe1"] = "绍三祖之业，重升汉道，卒以刷耻！",
  ["$rmt__zuhe2"] = "国统濒绝，宗庙之不血食，四十年于兹矣！",
}


skel:addEffect(fk.HpRecover, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    if target == player and player:hasSkill(skel.name) and not player:isWounded() then
      local surnames = {}
      for _, p in ipairs(player.room.alive_players) do
        if p.kingdom == "han" then
          local name = Fk:translate(p.general, "zh_CN")
          table.insertIfNeed(surnames, name[1])
          if name:len() > 3 then
            table.insertIfNeed(surnames, name[3])
          end
        end
      end
      local n = #surnames - player:getHandcardNum()
      if n > 0 then
        event:setCostData(self, n)
        return true
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(event:getCostData(self), skel.name)
  end,
})


return skel
